package org.rslai.tcedit.jms.service;

import org.rslai.tcedit.jms.JmsService;
import org.rslai.tcedit.web.service.RunConf;
import org.rslai.tcedit.web.service.TestCaseInfo;

/**
 * 运行测试用例<br/>
 * 
 * @author rslai
 */
public class RunTestCase implements JmsService{
	private static final long serialVersionUID = 1554724789120809547L;

	private RunConf runConf;
	private TestCaseInfo testCaseInfo;
	private String testCaseStr;

	/**
	 * 构造函数
	 * @param runConf 运行时配置，例如：被测网站的url、浏览器类型等等
	 * @param testCaseInfo 测试用例信息
	 * @param testCaseStr 测试用例内容字符串
	 */
	public RunTestCase(RunConf runConf, TestCaseInfo testCaseInfo, String testCaseStr) {
		this.runConf = runConf;
		this.testCaseInfo = testCaseInfo;
		this.testCaseStr = testCaseStr;
	}
	
	/**
	 * 覆写 toString() 方法
	 */
	public String toString() {
		StringBuffer sb = new StringBuffer();
		sb.append("[Method name: RunTestCase {");
		sb.append("productID:" + this.testCaseInfo.getProductID()); // 产品 ID
		sb.append(", versionID: " + this.testCaseInfo.getVersionID()); // 产品版本 ID
		sb.append(", scriptID:" + this.testCaseInfo.getScriptID()); // 脚本版本 ID
		sb.append(", testPlanID:" + this.testCaseInfo.getTestPlanID()); // 测试计划 ID
		sb.append(", testCaseID:" + this.testCaseInfo.getTestCaseID()); // 测试用例 ID
		sb.append("}]");
		return sb.toString();
	}

	@Override
	public void run() {
		System.out.println("===============jms run test case!");
	}

}
